
import 'dart:async';

import 'package:flutter/services.dart';
import 'package:tx_live_plugin/tx_constant.dart';

class TxLivePlugin {
  static const MethodChannel _channel = MethodChannel(Channel.plugin);

  static Future<String?> get platformVersion async {
    final String? version = await _channel.invokeMethod(PluginMethod.getPlatformVersion);
    return version;
  }

  ///专业版需要传递参数：{"licenseURL":"xxx", "licenceKey":"xxx"}
  static Future initApplicationForPro(String? licenceUrl,String? licenceKey){
    return TxLivePlugin.initApplication(params: {PluginKey.licenseURL:licenceUrl, PluginKey.licenceKey:licenceKey});
  }

  ///普通版可以不调用，专业版需要传递参数：{"licenseURL":"xxx", "licenceKey":"xxx"}
  static Future initApplication({Map<String,dynamic>? params}) {
    return _channel.invokeMethod(PluginMethod.init,params);
  }
}
